class Solution:
    def lengthOfLastWord(self, s):
        """
        :type s: str
        :rtype: int
        """
        return len(s.strip().split(' ')[-1])

s = Solution()
print('ss', s.lengthOfLastWord("Hello World"))
print('ss', s.lengthOfLastWord(""))
print('ss', s.lengthOfLastWord("Today is a nice day"))
print('ss', s.lengthOfLastWord("a "))

